// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import "babel-polyfill"
import Vue from 'vue'
import router from './router'
import VueResource from 'vue-resource'
import ElementUI from 'element-ui'
import $ from 'jquery'
import common from './common'
import 'element-ui/lib/theme-chalk/index.css'
import 'font-awesome/css/font-awesome.css'
import App from './App'

import '../static/css/common.css'
import '../static/css/swiper-4.3.3.min.css'
import Swiper from '../static/js/swiper-4.3.3.min.js'
Vue.use(VueResource);
Vue.use(ElementUI)
//拦截器
Vue.http.interceptors.push(function(request, next) {
  request.credentials = false;  
  next((res)=>{
    //401 登陆过期跳转
    if(res.data.status == 401 || res.status == 401){
      router.push("/login");
      common.setCookie('sessionId','')
    }
  })
})

Vue.config.productionTip = false


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
